

% interpolate HON data at WG sites
honfint = interp1(honfday, honf, fday + 7/24);
honfint(end) = honfint(end-1);

F_resid = ( F - nanmean(F)) - (honfint - nanmean(honfint))';
LL = isnan(F_resid);
p = fit([lat(~LL)' lon(~LL)'],F_resid(~LL)','poly11') ;
%scatter3(lat(~LL),lon(~LL),F_resid(~LL))
%hold on
%plot(p)
Z = feval(p,lat,lon);
plot(fday , F_resid - Z,'b', 'LineWidth',1);
hold on
plot(fday, honfint-nanmean(honfint),'g', 'LineWidth',2);
scatter3(lat,lon,F_resid);
p = fit([lat' lon'],F_resid','poly22','robust','LAR') ;
scatter3(lat,lon,F_resid)
hold
Current plot held
plot(p)
p = fit([lat' lon'],F','poly21') ; %21 was good
p = fit([lat' lon'],(F'-nanmean(F)),'poly11') ; %21 was good
scatter3(lat,lon,(F'-nanmean(F)))
hold on
plot(p)
close
plot(fday , Z,'b', 'LineWidth',1);
plot(fday , (F'-nanmean(F) - Z,'b', 'LineWidth',1);
plot(fday , (F'-nanmean(F)) - Z','b', 'LineWidth',1);
hold
Current plot held
plot(fday , (F'-nanmean(F)) ,'r', 'LineWidth',1);
plot(fday, honfint-nanmean(honfint),'g', 'LineWidth',2);
p = fit([lat' lon'],(F'),'poly11') ; %21 was good
plot(fday , (F'-nanmean(F)) - Z','b', 'LineWidth',1);
hold
Current plot held
Z = feval(p,lat,lon);
plot(fday , F - nanmean(F),'r', 'LineWidth',1);
hold on
Z = feval(p,lat,lon);
plot(fday, honfint-nanmean(honfint),'g', 'LineWidth',2);
plot(fday , F-Z,'c', 'LineWidth',1);
p = fit([lat' lon'],(F'),'poly11') ; %21 was good
p = fit([lat' lon'],(F'-nanmean(F)),'poly22') ; %21 was good